package com.example.web;

import com.example.common.ServiceResponse;
import com.example.common.TableServerResponse;
import com.example.pojo.Parking;
import com.example.service.IParkingService;
import com.example.vo.ParkingListVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @BelongsProject: gxcwhd
 * @BelongsPackage: com.example.web
 * @Author: LJ
 * @CreateTime: 2020-08-17 11:13
 * @Description:
 */
@RestController
@RequestMapping("Parking")
public class ParkingController {

    @Autowired
    IParkingService parkingService;


    //查车位
    @RequestMapping("get-parkingList")
    public TableServerResponse getParkingInfo(Integer page,Integer limit){
        System.out.println(page);
        return parkingService.getParkingInfo(page,limit);
    }

    //审核车位
    @RequestMapping("verify")
    public ServiceResponse verify(ParkingListVO parkingListVO){
        return parkingService.verify(parkingListVO);
    }

    //模糊查询车位
    @RequestMapping("search-parking")
    public TableServerResponse searchParking(ParkingListVO parkingListVO){
        return parkingService.searchParking(parkingListVO);
    }

//    //添加车es车位
//    @RequestMapping("add-esparking")
//    public ServiceResponse addEsParking(@RequestBody Parking parking){
//        return parkingService.addEsParking(parking);
//    }
//
//    //es搜索
//    @RequestMapping("search-esparking")
//    public TableServerResponse searchEsParking(@RequestBody Parking parking){
//        return parkingService.searchEsParking(parking);
//    }
//
//    //es根据物业Id删除车位
//    @RequestMapping("delete-esparking/{propertyId}")
//    public ServiceResponse deleteEsParking(@PathVariable("propertyId")String propertyId){
//        return parkingService.deleteParkingById(propertyId);
//    }
//
//    //修改车位
//    @PostMapping("/updateParking")
//    public Object updateOrder(@RequestBody Parking parking){
//        return parkingService.updateParking(parking);
//    }
}
